From 11ddbffa71ea549a831b4e93238a4f4b67d49bd9 Mon Sep 17 00:00:00 2001 From: Wil Mahan Date: Tue, 21 Sep 2004 05:12:44 +0000 Subject: [PATCH] Completely remove variableSubstitution(), because magic variable replacement is redundantly done in braceSubstitution(). Aside from removing unnecessary code, this will make it easier to fix bug 89, parameters to {{subst:}} templates --- includes/Parser.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 48f4496ea2..fae9afc294 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1434,11 +1434,6 @@ class Parser # PHP global rebinding syntax is a bit weird, need to use the GLOBALS array $GLOBALS['wgCurParser'] =& $this; - if ( $this->mOutputType == OT_HTML || $this->mOutputType == OT_MSG ) { - # Variable substitution - $text = preg_replace_callback( "/{{([$titleChars]*?)}}/", 'wfVariableSubstitution', $text ); - } - if ( $this->mOutputType == OT_HTML ) { # Argument substitution $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text ); @@ -1453,19 +1448,6 @@ class Parser return $text; } - function variableSubstitution( $matches ) { - if ( !$this->mVariables ) { - $this->initialiseVariables(); - } - if ( array_key_exists( $matches[1], $this->mVariables ) ) { - $text = $this->mVariables[$matches[1]]; - $this->mOutput->mContainsOldMagic = true; - } else { - $text = $matches[0]; - } - return $text; - } - # Split template arguments function getTemplateArgs( $argsString ) { if ( $argsString === '' ) { @@ -2558,11 +2540,6 @@ function wfArgSubstitution( $matches ) { return $wgCurParser->argSubstitution( $matches ); } -function wfVariableSubstitution( $matches ) { - global $wgCurParser; - return $wgCurParser->variableSubstitution( $matches ); -} - /** * Return the total number of articles */ -- 2.20.1